package org.slg.oracleproject.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Web基础配置：跨域+静态资源访问
 */
@Configuration
public class WebConfig implements WebMvcConfigurer {

    /**
     * 静态资源映射（项目文件）
     */
    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/project_file/**")
                .addResourceLocations("file:/project/zhwl/java/image/project_file/");
    }

}